package com.example.novelstory.controller.lxy;

import com.example.novelstory.entity.BookShelf;
import com.example.novelstory.service.lxy.BookShelfServImpl;
import com.example.novelstory.utill.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户书架控制器")
@RestController
@CrossOrigin
public class BookShelfController {
    @Resource
    BookShelfServImpl bookShelfServ;

    @PostMapping(value = "/bookSelfFind")
    @ApiOperation(value = "书架查询")
    public List<BookShelf> bookfind(){
//        List<BookShelf> bookShelfList=bookShelfServ.UserBook();
        return bookShelfServ.UserBook();
    }
    @PostMapping(value = "/bookSelfInsert")
    @ApiOperation(value = "添加书架")
    public boolean bookinsert(@RequestBody BookShelf bookShelf){
//        List<BookShelf> bookShelfList=bookShelfServ.bookinsert(anthor_id, title);
        return bookShelfServ.bookinsert(bookShelf);
    }
    @PostMapping(value = "/bookSelfDelete")
    @ApiOperation(value = "书架删除书籍")
    public Result bookdelete(@RequestBody BookShelf bookShelf){
//        List<BookShelf> bookShelfList=bookShelfServ.bookdelete(title);
        return bookShelfServ.bookdelete(bookShelf);
    }
    @PostMapping(value = "/bookSelfLikeSearch")
    @ApiOperation(value = "书架模糊搜索本地书籍")
    public Result bookSelfLikeSearchController(@RequestBody BookShelf bookShelf){
        return bookShelfServ.bookSelfLikeSearch(bookShelf);
    }

}
